package com.ruoyi.shopping.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.shopping.mapper.MallCommissionRecordMapper;
import com.ruoyi.shopping.domain.MallCommissionRecord;
import com.ruoyi.shopping.service.IMallCommissionRecordService;

/**
 * 佣金记录Service业务层处理
 *
 * @author scx
 * @date 2022-06-10
 */
@Service
public class MallCommissionRecordServiceImpl implements IMallCommissionRecordService
{
    @Autowired
    private MallCommissionRecordMapper mallCommissionRecordMapper;

    /**
     * 查询佣金记录
     *
     * @param id 佣金记录主键
     * @return 佣金记录
     */
    @Override
    public MallCommissionRecord selectMallCommissionRecordById(Long id)
    {
        return mallCommissionRecordMapper.selectMallCommissionRecordById(id);
    }

    /**
     * 查询佣金记录列表
     *
     * @param mallCommissionRecord 佣金记录
     * @return 佣金记录
     */
    @Override
    public List<MallCommissionRecord> selectMallCommissionRecordList(MallCommissionRecord mallCommissionRecord)
    {
        return mallCommissionRecordMapper.selectMallCommissionRecordList(mallCommissionRecord);
    }

    /**
     * 新增佣金记录
     *
     * @param mallCommissionRecord 佣金记录
     * @return 结果
     */
    @Override
    public int insertMallCommissionRecord(MallCommissionRecord mallCommissionRecord)
    {
        mallCommissionRecord.setCreateTime(DateUtils.getNowDate());
        return mallCommissionRecordMapper.insertMallCommissionRecord(mallCommissionRecord);
    }

    /**
     * 修改佣金记录
     *
     * @param mallCommissionRecord 佣金记录
     * @return 结果
     */
    @Override
    public int updateMallCommissionRecord(MallCommissionRecord mallCommissionRecord)
    {
        mallCommissionRecord.setUpdateTime(DateUtils.getNowDate());
        return mallCommissionRecordMapper.updateMallCommissionRecord(mallCommissionRecord);
    }

    /**
     * 批量删除佣金记录
     *
     * @param ids 需要删除的佣金记录主键
     * @return 结果
     */
    @Override
    public int deleteMallCommissionRecordByIds(Long[] ids)
    {
        return mallCommissionRecordMapper.deleteMallCommissionRecordByIds(ids);
    }


    /**
     * 批量逻辑删除佣金记录
     *
     * @param ids 需要删除的佣金记录主键
     * @return 结果
     */
    @Override
    public int logicDeleteMallCommissionRecord(Long[] ids,String delType,Long delUser)
    {
        return mallCommissionRecordMapper.logicDeleteMallCommissionRecord(ids,delType,delUser);
    }

    /**
     * 删除佣金记录信息
     *
     * @param id 佣金记录主键
     * @return 结果
     */
    @Override
    public int deleteMallCommissionRecordById(Long id)
    {
        return mallCommissionRecordMapper.deleteMallCommissionRecordById(id);
    }
}
